#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#

# this is read by the standalone daemon and embedded servers
[server]

# this is only for the mysqld standalone daemon
[mysqld]

#
# * Galera-related settings
#
[galera]
# Mandatory settings
wsrep_on=ON
wsrep_provider=/usr/lib64/galera-4/libgalera_smm.so
wsrep_cluster_name=mm_fgdp_cluster
wsrep_cluster_address=gcomm://10.238.3.190:4567,10.238.3.191:4567
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
bind-address=0.0.0.0
#
# Optional setting
wsrep_slave_threads=1
# innodb_flush_log_at_trx_commit=0


# 2021-04-08 http://itgnev.ru/%D0%BD%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B0-galera-%D0%BA%D0%BB%D0%B0%D1%81%D1%82%D0%B5%D1%80%D0%B0-%D0%BD%D0%B0-mariadb-%D1%81-master-master-%D1%80%D0%B5%D0%BF%D0%BB%D0%B8%D0%BA%D0%B0/
innodb_locks_unsafe_for_binlog=1
query_cache_size=0
query_cache_type=0
innodb_log_file_size=100M
innodb_flush_log_at_trx_commit=2
wsrep_node_address="10.238.3.191"
wsrep_node_name="mmfgdp02"
wsrep_sst_method=rsync
wsrep_sst_auth=root:1

# this is only for embedded server
[embedded]

# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]

datadir=/mariadb
# socket=/mariadb/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
lower_case_table_names=1
character_set_server=utf8
collation-server=utf8_bin
max_allowed_packet=50M
default_time_zone='+03:00'

innodb=FORCE
innodb_file_format=Barracuda
innodb_file_per_table=true


# 2018-01-13 Skip reverse DNS lookup of clients and enternal network
skip-name-resolve
binlog_format=ROW

# bind-address=127.0.0.1
max_connections = 4096

default_storage_engine=innodb

# 2021-03-31 mvk мигание связи с клиентами вызывает ошибки записи ISkSession вида: "1205 Lock wait timeout exceeded; try restarting transaction"
# https://severalnines.com/database-blog/how-fix-lock-wait-timeout-exceeded-error-mysql
# https://www.percona.com/blog/2020/07/27/the-transaction-behavior-impact-of-innodb_rollback_on_timeout-in-mysql/
innodb_rollback_on_timeout=ON
# default value = 50
innodb_lock_wait_timeout=1

# mvk "2" need for galera. https://mariadb.com/kb/en/mariadb/xtradbinnodb-server-system-variables/#innodb_autoinc_lock_mode
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=0

# Galera recommends:
# innodb_buffer_pool_size=122M

# tm main server
innodb_buffer_pool_size=2048M
innodb_buffer_pool_instances=2


# mvk https://mariadb.com/kb/en/mariadb/xtradbinnodb-server-system-variables/#innodb_change_buffer_max_size
innodb_change_buffer_max_size=50

# mvk https://ruhighload.com/post/%D0%92%D1%8B%D0%B1%D0%BE%D1%80+innodb_flush_method+%D0%BC%D0%B5%D0%B6%D0%B4%D1%83+O_DSYNC+%D0%B8+O_DIRECT
# innodb_flush_method=O_DSYNC
innodb_flush_method=O_DIRECT

thread_concurrency=48
innodb_thread_concurrency=48

# innodb_log_file_size=1024M

# tm main server
# 2021-04-08 mvk (galera already defined)
# innodb_log_file_size=10G

# tm local server
# innodb_log_file_size=512M

max_heap_table_size=32M

# mvk ??? (взято из примера: https://www.percona.com/blog/2016/05/31/what-is-a-big-innodb_log_file_size/).
# innodb_io_capacity=5000.
# innodb_io_capacity_max=7500



# This group is only read by MariaDB-10.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.5]

